#ifndef CHWND_H
#define CHWND_H

#include "base.h"
#include "Windowsx.h"
#include <stddef.h>
#include "cProperty.h"
#include "cEvent.h"
#include "cUtils.h"
class cHwnd;

typedef void(cHwnd::*functionEvenement)(cEvent*);

struct PopupEvent{
    string libelle;
};

typedef void(cHwnd::*evenementPopup)(PopupEvent*);

class cHwnd : public cBase
{
    public:
                            cHwnd();
        virtual             ~cHwnd();
        HWND                getHwnd(){return hWnd;}
        void                SetVisible(bool visibilite);
        static              BOOL CALLBACK       ResizingParent(HWND hwndChild,LPARAM rectangle);
        static              BOOL CALLBACK       DeleteChilds(HWND hwndChild,LPARAM rectangle);
        virtual bool        ResizingParentChild(HWND hwndChild,LPARAM rectangle)=0;
    private:

    protected:
        HWND                hWnd;
        int                 OnCommand(HWND hwnd,UINT message,WPARAM wparam,LPARAM lParam);
        void                Alerte(string titre,string message,UINT type=MB_OK);
        virtual bool        TraitementEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,LRESULT & resultat)=0;

};

#endif // CHWND_H
